<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改属性')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-bute-edit" th:object="${objectAttribute}">
            <input name="objectId" th:field="*{objectId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">父部门id：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
                        <input class="form-control" type="text" onclick="selectButeTree()" id="treeName" readonly="true" th:field="*{parentName}">
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">对象名称：</label>
                <div class="col-sm-8">
                    <input name="objectName" th:field="*{objectName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">一级对象类型：</label>
                <div class="col-sm-8">
                    <select name="aObjectType" class="form-control m-b" th:with="type=${@dict.getType('a_object_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{aObjectType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">二级对象类型：</label>
                <div class="col-sm-8">
                    <select name="bObjectType" class="form-control m-b" th:with="type=${@dict.getType('b_object_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{bObjectType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">对象状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('object_name_status')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="j1" th:field="*{j1}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">IP：</label>
                <div class="col-sm-8">
                    <input name="j2" th:field="*{j2}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">域名：</label>
                <div class="col-sm-8">
                    <input name="j3" th:field="*{j3}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j4：</label>
                <div class="col-sm-8">
                    <input name="j4" th:field="*{j4}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j5：</label>
                <div class="col-sm-8">
                    <input name="j5" th:field="*{j5}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j6：</label>
                <div class="col-sm-8">
                    <input name="j6" th:field="*{j6}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j7：</label>
                <div class="col-sm-8">
                    <input name="j7" th:field="*{j7}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j8：</label>
                <div class="col-sm-8">
                    <input name="j8" th:field="*{j8}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j9：</label>
                <div class="col-sm-8">
                    <input name="j9" th:field="*{j9}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j10：</label>
                <div class="col-sm-8">
                    <input name="j10" th:field="*{j10}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j11：</label>
                <div class="col-sm-8">
                    <input name="j11" th:field="*{j11}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j12：</label>
                <div class="col-sm-8">
                    <input name="j12" th:field="*{j12}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j13：</label>
                <div class="col-sm-8">
                    <input name="j13" th:field="*{j13}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j14：</label>
                <div class="col-sm-8">
                    <input name="j14" th:field="*{j14}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j15：</label>
                <div class="col-sm-8">
                    <input name="j15" th:field="*{j15}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j16：</label>
                <div class="col-sm-8">
                    <input name="j16" th:field="*{j16}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j17：</label>
                <div class="col-sm-8">
                    <input name="j17" th:field="*{j17}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j18：</label>
                <div class="col-sm-8">
                    <input name="j18" th:field="*{j18}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j19：</label>
                <div class="col-sm-8">
                    <input name="j19" th:field="*{j19}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">j20：</label>
                <div class="col-sm-8">
                    <input name="j20" th:field="*{j20}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/bute";
        $("#form-bute-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-bute-edit').serialize());
            }
        }

        /*属性-新增-选择父部门树*/
        function selectButeTree() {
            var options = {
                title: '属性选择',
                width: "380",
                url: prefix + "/selectButeTree/" + $("#treeId").val(),
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){
            var body = layer.getChildFrame('body', index);
               $("#treeId").val(body.find('#treeId').val());
               $("#treeName").val(body.find('#treeName').val());
               layer.close(index);
        }
    </script>
</body>
</html>